/*
** my_strdup.c for  in /home/vanet_c//piscine/Jour_08/ex_01
** 
** Made by charles-edouard vanet
** Login   <vanet_c@epitech.net>
** 
** Started on  Wed Oct 10 09:03:48 2012 charles-edouard vanet
** Last update Thu Dec  6 11:48:19 2012 charles-edouard vanet
*/

#include	<stdlib.h>

char	*my_strdup(char *src)
{
  int	i;
  char	*str;

  i = 0;
  while (src[i] != '\0')
    i++;
  if ((str = malloc(sizeof(char) * i + 1)) == NULL)
    return (NULL);
  i = 0;
  while (src[i] != '\0')
    {
      str[i] = src[i];
      i++;
    }
  str[i] = '\0';
  return (str);
}
